﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Portal.Web.Areas.Admin.Controllers
{
    public class SystemController : Controller
    {

        /// <summary>
        /// 获取系统语言JSON
        /// </summary>
        /// <param name="value">选中值</param>
        /// <param name="sort">排序</param>
        /// <param name="order">排序关键字</param>
        /// <returns></returns>
        public ActionResult GetCultureComboBoxJson(string value, string sort = "Sort", string order = "DESC")
        {
            var list = SystemCulture.List.JqEasyuiComboBox(o => new JqEasyuiComboBox { id = o.Code, text = o.Name });
            var selected = list.FirstOrDefault(o => o.id == value);
            if (selected != null) selected.selected = true;
            return Json(list);

        }
    }
}
